#include "mainwindow.h"
#include "./ui_mainwindow.h"

#include <QThreadPool>

#include "Task.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{
    for (int i = 0; i < 5; ++i) {
        Task *task = new Task();
        task->SetIdx(i + 1);
        QThreadPool::globalInstance()->start(task);
    }
}

